clc;
clear all;
%% Set PWM Switching frequency
PWM_frequency 	= 20e3;    %Hz          // converter s/w freq
T_pwm           = 1/PWM_frequency;  %s  // PWM switching time period

%% Set Sample Times
Ts          	= T_pwm;        %sec        // Sample time step for controller
Ts_simulink     = T_pwm/2;      %sec        // Simulation time step for model simulation
Ts_motor        = T_pwm/2;      %Sec        // Simulation sample time
Ts_inverter     = T_pwm/2;      %sec        // Simulation time step for average value inverter
Ts_speed        = 10*Ts;        %Sec        // Sample time for speed controller
T          	    = T_pwm; 

R=0.196;
L=0.014;
L1=0.014;
L2=0.014;
flux_m = 0.0017;
kp_c=3.44;
ki_c=1476;
kp_sp=0.01;
ki_sp=0.5;    
kp_pll=60;
ki_pll=900;
theta_sw=2*pi;
theta_sw1=2*pi;
wc_ob=3000;